package LuoGu.入门.ABC;

import java.math.BigInteger;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        BigInteger ans = new BigInteger("0");
        for(int i=1;i<=n;i++){
            BigInteger temp = new BigInteger("1");
            for(int j=1;j<=i;j++) {
                temp = temp.multiply(new BigInteger(String.valueOf(j)));
            }
            ans = ans.add(temp);
        }System.out.print(ans);
    }
}
